Repository: transformers
Issue: Segmentation fault: address not mapped to object at address 0x100000007
Labels: bug

### System Info

transformers-cli env causes the same Segfault.
Uname-a: `Linux matteo-thinkpadr61 6.12.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 02 Jan 2025 22:52:26 +0000 x86_64 GNU/Linux
`
[cpuinfo.txt](https://github.com/user-attachments/files/18385563/cpuinfo.txt)
[piplist.txt](https://github.com/user-attachments/files/18385564/piplist.txt)


### Who can help?

_No response_

### Information

- [X] The official example scripts
- [X] My own modified scripts

### Tasks

- [X] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

`from transformers import AutoTokenizer, AutoModelWithLMHead, pipeline, GPT2Tokenizer
`
[problema_hf.txt](https://github.com/user-attachments/files/18385565/problema_hf.txt)

### Expected behavior

Hi!
I get a segmentation fault error whenever I try to import modules such as GPT2Tokenizer, GPT2Model, AutoTokenizer or AutoModelForCausalLM using version 4.48.0 of transformers installed from pip. The problem happens also with versions 4.47.1 and 4.47.0

By using version 4.46.3, instead, the issue is less severe, for example I can import GPT2Tokenizer, GPT2Model but still not AutoTokenizer or AutoModelForCausalLM or run transformers-cli env. I tried a random older version 4.36.1, and still segmentation fault on transformers-cli-env

The machine I am using it's not new: it's a Thinkpad R61 with Intel T9300 CPU, 8GB of DDR2 RAM and 1TB SSD. Even if the problem may lie in an old CPU I think it's important to notice if some update broke compatibility with older hardware, as they may be still in use by someone (yes, it seems incredible but I am very happily doing research on llm on that machine, with Arch it runs very fast and I have a remote HPC server at disposal for heavy jobs. I don't like to change things that works. ) Moreover it doesn't look like an Illegal Instruction error, so I am not sure CPU can be the issue.
Unfortunately I do not recall if I already ran successfully transformers on this machine, perhaps in October.
Datasets library works perfectly: I use it very often on this machine even for large datasets and I never had a problem.

I attach: segmentation fault error, cpuid output, list of installed packages

[problema_hf.txt](https://github.com/user-attachments/files/18385565/problema_hf.txt)
[cpuinfo.txt](https://github.com/user-attachments/files/18385563/cpuinfo.txt)
[piplist.txt](https://github.com/user-attachments/files/18385564/piplist.txt)

```
Caught signal 11 (Segmentation fault: address not mapped to object at address 0x100000007)
==== backtrace (tid: 105455) ====
 0 0x000000000004c822 ucs_event_set_fd_get()  ???:0
 1 0x000000000004c9ed ucs_event_set_fd_get()  ???:0
 2 0x000000000003d1d0 __sigaction()  ???:0
 3 0x00000000001c6b36 PyLong_AsInt()  ???:0
 4 0x000000000017a284 _PyEval_EvalFrameDefault()  ???:0
 5 0x0000000000240ce5 PyEval_EvalCode()  ???:0
 6 0x000000000025a444 _PyDict_DelItemIf()  ???:0
 7 0x000000000018c55d _PyFunction_SetVersion()  ???:0
 8 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
 9 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
10 0x00000000001cc09a PyObject_CallMethodObjArgs()  ???:0
11 0x00000000001cb173 PyImport_ImportModuleLevelObject()  ???:0
12 0x000000000017a2b4 _PyEval_EvalFrameDefault()  ???:0
13 0x0000000000240ce5 PyEval_EvalCode()  ???:0
14 0x000000000025a444 _PyDict_DelItemIf()  ???:0
15 0x000000000018c55d _PyFunction_SetVersion()  ???:0
16 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
17 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
18 0x00000000001cc09a PyObject_CallMethodObjArgs()  ???:0
19 0x00000000001cb173 PyImport_ImportModuleLevelObject()  ???:0
20 0x000000000017a2b4 _PyEval_EvalFrameDefault()  ???:0
21 0x0000000000240ce5 PyEval_EvalCode()  ???:0
22 0x000000000025a444 _PyDict_DelItemIf()  ???:0
23 0x000000000018c55d _PyFunction_SetVersion()  ???:0
24 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
25 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
26 0x00000000001cc09a PyObject_CallMethodObjArgs()  ???:0
27 0x00000000001cb173 PyImport_ImportModuleLevelObject()  ???:0
28 0x000000000017a2b4 _PyEval_EvalFrameDefault()  ???:0
29 0x0000000000240ce5 PyEval_EvalCode()  ???:0
30 0x000000000025a444 _PyDict_DelItemIf()  ???:0
31 0x000000000018c55d _PyFunction_SetVersion()  ???:0
32 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
33 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
34 0x00000000001cc09a PyObject_CallMethodObjArgs()  ???:0
35 0x00000000001cb173 PyImport_ImportModuleLevelObject()  ???:0
36 0x000000000018c55d _PyFunction_SetVersion()  ???:0
37 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
38 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
39 0x00000000001cc09a PyObject_CallMethodObjArgs()  ???:0
40 0x00000000001cb173 PyImport_ImportModuleLevelObject()  ???:0
41 0x000000000017a2b4 _PyEval_EvalFrameDefault()  ???:0
42 0x0000000000240ce5 PyEval_EvalCode()  ???:0
43 0x000000000025a444 _PyDict_DelItemIf()  ???:0
44 0x000000000018c55d _PyFunction_SetVersion()  ???:0
45 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
46 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
47 0x00000000001cc09a PyObject_CallMethodObjArgs()  ???:0
48 0x00000000001cb173 PyImport_ImportModuleLevelObject()  ???:0
49 0x000000000017a2b4 _PyEval_EvalFrameDefault()  ???:0
50 0x0000000000240ce5 PyEval_EvalCode()  ???:0
51 0x000000000025a444 _PyDict_DelItemIf()  ???:0
52 0x000000000018c55d _PyFunction_SetVersion()  ???:0
53 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
54 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
55 0x00000000001cc09a PyObject_CallMethodObjArgs()  ???:0
56 0x00000000001cb173 PyImport_ImportModuleLevelObject()  ???:0
57 0x000000000018c55d _PyFunction_SetVersion()  ???:0
58 0x00000000001771b4 _PyEval_EvalFrameDefault()  ???:0
59 0x00000000001943c4 PyObject_GenericGetAttr()  ???:0
=================================
Errore di segmentazione (core dump creato)

```